﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Legend.Component.Common;
using Legend.Component.Interface;
using Legend.Component.Prop;
using Legend.Object;

namespace Legend.Component.Bullet
{
    public class WeaponDamaging : IDamaging
    {
        public WeaponDamaging()
        {
            DamageDisposition = IDamaging.DamageType.Weapon | IDamaging.DamageType.HeroFriendly;
        }

        public override string Status
        {
            get { return ""; }
        }

        public override ResolveResult ResolveDamaging(IDamaging.DamageType fromDisposition, float fromDamage, string fromStatus)
        {
            if ((fromDisposition & DamageType.HeroFriendly) != 0)
            {
                return ResolveResult.Continue;
            }

            if ((fromDisposition & DamageType.Box) != 0 && fromStatus == BoxDamaging.BoxStatus.Revealed.ToString())
            {
                return ResolveResult.Continue;
            }

            if ((fromDisposition & DamageType.EnemyFriendly) != 0)
            {
                GameObjectManager.AddBoardValue("Combo", 1);
            }

            return ResolveResult.Disappear;
        }
    }
}
